﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.Model;
using Automobile.service.BLL;

namespace Automobile.service.UI
{
    public partial class StockShow : System.Web.UI.Page
    {
        StockBLL bll = new StockBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                StockLoad();
                Session["count"] = bll.Count();
            }
        }
        public void StockLoad()
        {
            this.AspNetPager1.PageSize = 4;
            this.AspNetPager1.RecordCount = bll.Count();
            this.Repeater1.DataSource = bll.ShowStock( this.AspNetPager1.CurrentPageIndex,4);
            this.Repeater1.DataBind();
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {

            StockLoad();
        }
    }
}